package org.zhao.nettydemos.utils;

import com.alibaba.fastjson.JSONObject;

/**
 * @Auther: xiaohui.zhao
 * @Date: 2021/9/16 17:33
 * @Description:
 */
public class JsonUtil {

    public static <T> T jsonToPojo(String jsonString , Class<T> tClass){
        T t = JSONObject.parseObject(jsonString,tClass);
        return t;
    }

    public static String pojoToJson(Object obj){
        return JSONObject.toJSONString(obj);
    }

}